home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / NextAnswers / 1188_subproject_miscellanea.rtf < prev    next >
Text File  |  1995-06-12  |  5KB  |  120 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Courier;\f1\fmodern Ohlfs;}
  2. \paperw14220
  3. \paperh10140
  4. \margl120
  5. \margr120
  6. {\colortbl;\red0\green0\blue0;}
  7. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc1\cf1 Q: How can I use a class from a subproject in another project?\
  8. \
  9. A: You can drag any .h file from a subproject into the classes suitcase of another project's nib.  From there you can instantiate, and make connections freely.\
  10. \
  11. In 
  12. \b Release 3
  13. \b0 , you can add the .h file into the ProjectBuilder Classes directory by using the Add command in the Files menu.  From there, you have to use InterfaceBuilder to instantiate an object, and make the connections. \
  14. \
  15. Q: How can I make connections between objects in my subproject and those in the main project?\
  16. \
  17. A: You can't.  You need to make the association in your code.  The object that is the nib file's owner should take care of communicating with any other objects (including the owners of other nib files).\
  18. \
  19. See ../NEXTSTEP_Developer/AppKit/connecting_between_nibs.rtf for more information regarding object communication between nib files.\
  20. \
  21. Q:  When I modify the definition of a class that is located in a subproject, how do I get InterfaceBuilder to recognize the new outlets or actions?  Parse just gives an error: "Cannot find class definition."\
  22. \
  23. A:  This is a limitation of InterfaceBuilder in its current incarnation.  \
  24. \
  25. In 
  26. \b Release 2
  27. \b0 , once a class definition (or .h file) has been dropped into the Classes suitcase from the Workspace Manager, InterfaceBuilder does not have any idea where the files for that class are located.  Therefore, you cannot parse classes from a subproject.  You must simply drag the .h file onto the Classes suitcase again.  InterfaceBuilder then displays an alert panel indicating that there are different outlets or actions for that class.  Choose "Replace" and the class changes to reflect the changes made to the .h file.\
  28. \
  29. In 
  30. \b Release 3
  31. \b0 , you need to explicitly reparse the .h file by selecting the Classes suitcase, then the proper object in the class browser, and choosing the Parse command from the Operations pop-up list.\
  32. \
  33. Q: The debugger can't find the source files to my subproject classes.  Help!\
  34. \
  35. A: In 
  36. \b Release 2
  37. \b0 , you must notify 
  38. \b gdb
  39. \b0  where the subproject's files are located.  You can accomplish this with the 
  40. \b directory
  41. \b0  or 
  42. \b idirectory
  43. \b0  commands in 
  44. \b gdb
  45. \b0 :\
  46. \
  47.  
  48. \f2\fs24     (gdb) dir <pathname>\
  49.  
  50. \f1\fs22     \
  51.  
  52. \f0\fs28 If you don't want to type this every time you invoke 
  53. \b gdb
  54. \b0 , place this command in your 
  55. \b .gdbinit
  56. \b0  file.  See the 
  57. \b gdb
  58. \b0  man page for more information.\
  59. \
  60. In 
  61. \b Release 3
  62. \b0 ,  the 
  63. \b idirectory 
  64. \b0 command no longer exists. ProjectBuilder generates a 
  65. \b PB.gdbinit 
  66. \b0 file at the top level project directory. This file contains 
  67. \b "directory"  
  68. \b0 commands for each subproject. When running the debugger from ProjectBuilder, this file is read in automatically.  If you are running gdb from the command line, you can read this file in at startup time by typing the following in a terminal shell:\
  69. \
  70.  
  71. \f2\fs24     localhost> gdb Foo.app/Foo -x PB.gdbinit\
  72.  
  73. \f1\fs22 \
  74.  
  75. \f0\fs28 Or if you have already run gdb, you can read it in by typing on gdb's command line:\
  76. \
  77.  
  78. \f2\fs24     (gdb) source PB.gdbinit\
  79.  
  80. \f0\fs28 \
  81.  
  82. \b Note: The following two questions and answer pairs apply to NEXTSTEP  Release 2 only.\
  83.  
  84. \b0 \
  85. Q:  Is there an easy way to include subproject class definitions in the main project of my application?\
  86. \
  87. A:  Yes, there is.  When you compile the subproject 
  88. \b foo.subproj
  89. \b0 ,
  90. \b  
  91. \b0 a .h file for the entire subproject is created in the main project's directory.  You can import this .h file.  The name of the .h file, in the case of our example, is 
  92. \b foo.h
  93. \b0 .  This file imports all of the class definitions contained in the subproject 
  94. \b foo.subproj
  95. \b0 . This may be overkill, especially if you have many classes in your subproject that are not interdependent.  If so, you can also include them individually by using the following import command:\
  96. \
  97.  
  98. \f2\fs24     #import "foo.subproj/FooBar.h\
  99.  
  100. \f0\fs28 \
  101. Q: When I try to 
  102. \b make 
  103. \b0 an application containing a subproject, I get the following error:\
  104. \
  105.  
  106. \f2\fs24     (cd foo.subproj; make ofiles "NAME=foo" "_CFLAGS= -O -g -Wall"  "OFILE_DIR = obj" "LIBS=")\
  107.     mkdirs obj\
  108.     ld -r -o ../obj/foo.o\
  109.     ld: no object files specified\
  110.  
  111. \f0\fs28 \
  112. A: This is an InterfaceBuilder bug that you can encounter if your subproject contains no class definition files.   Consider whether you really need a subproject in this case.  The workaround is to create a dummy class and add its .h and .m files to your subproject. \
  113. \
  114. QA792\
  115. \
  116. Not valid for 1.0    (subprojects were added for 2.0)\
  117. Valid for 2.0, 3.0, 3.1\
  118. \
  119.  
  120.